﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication1
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void loogin_Click(object sender, EventArgs e)
        {
            var uid = txtUsername.Text.Trim();
            var pwd = txtPassword.Text.Trim();

            var sql = string.Format("select * from bigold where Name = '{0}' and Password = '{1}'", uid, pwd);
            var ba = DbHelper.GetData(sql);
            if(ba.Rows.Count == 1)
            {
                //登录成功
                Response.Redirect("laojing.aspx");
            }
            else
            {
                //登录失败，再见
                lblComment.Text = "登录失败，再见";
            }
        }

        protected void news_Click(object sender, EventArgs e)
        {

        }
    }
}